package application

import (
	"context"
	"service-hello/api"
)

type App struct {
	api.UnsafeTemplateServer
}

var _ api.TemplateServer = (*App)(nil)

func (app *App) Hello(ctx context.Context, r *api.HelloRequest) (*api.HelloResponse, error) {
	return &api.HelloResponse{
		Message: "Hello " + r.Name,
	}, nil
}
func (app *App) Add(ctx context.Context, r *api.AddRequest) (*api.AddResponse, error) {
	return &api.AddResponse{
		Total: r.A + r.B,
	}, nil
}
